apiVersion: v1
kind: Namespace
metadata:
  name: {{NAMESPACE}}
---
apiVersion: v1
kind: Service
metadata:
  name: {{APP_NAME}}
  namespace: {{NAMESPACE}}
spec:
  type: ClusterIP
  ports:
  - port: 5611
    protocol: TCP
    targetPort: 5611
  selector:
    app: {{APP_NAME}}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{APP_NAME}}
  namespace: {{NAMESPACE}}
spec:
  selector:
    matchLabels:
      app: {{APP_NAME}}
  replicas: 3
  template:
    metadata:
      labels:
        app: {{APP_NAME}}
    spec:
      containers:
        - name: {{APP_NAME}}
          env:
            - name: TZ
              value: Asia/Shanghai
          image: {{IMAGE_URL}}:{{IMAGE_TAG}}
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 5611
              name: port
              protocol: TCP
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  annotations:
  name: {{APP_NAME}}-ingress
  namespace: {{NAMESPACE}}
spec:
  rules:
    - host: {{HOST}}
      http:
        paths:
        - path: /
          backend:
            serviceName: {{APP_NAME}}
            servicePort: 5611
